package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 异动监测结果表
 * @TableName anomaly_monitor_result
 */
@TableName(value ="anomaly_monitor_result")
@Data
public class AnomalyMonitorResult {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 监测类型(commodity:商品,port:口岸,trade:业态,region:地区,country:国别)
     */
    private String monitorType;

    /**
     * 监测日期
     */
    private Date monitorDate;

    /**
     * 维度值(如商品名称,口岸名称等)
     */
    private String dimensionValue;

    /**
     * 金额
     */
    private BigDecimal amount;

    /**
     * 金额同比(%)
     */
    private BigDecimal amountYoy;

    /**
     * 金额环比(%)
     */
    private BigDecimal amountMom;

    /**
     * 数量
     */
    private BigDecimal quantity;

    /**
     * 数量同比(%)
     */
    private BigDecimal quantityYoy;

    /**
     * 数量环比(%)
     */
    private BigDecimal quantityMom;

    /**
     * 24个月最大增幅(%)
     */
    private BigDecimal maxIncrease;

    /**
     * 24个月最大降幅(%)
     */
    private BigDecimal minDecrease;

    /**
     * 上限阈值
     */
    private BigDecimal thresholdUpper;

    /**
     * 下限阈值
     */
    private BigDecimal thresholdLower;

    /**
     * 是否异常
     */
    private Integer isAnomaly;

    /**
     * 币制
     */
    private String currencyType;

    /**
     * 所属关区ID
     */
    private Integer customsId;

    /**
     * 数据源
     */
    private String dataSource;

    /**
     * 
     */
    private Date createTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AnomalyMonitorResult other = (AnomalyMonitorResult) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getMonitorType() == null ? other.getMonitorType() == null : this.getMonitorType().equals(other.getMonitorType()))
            && (this.getMonitorDate() == null ? other.getMonitorDate() == null : this.getMonitorDate().equals(other.getMonitorDate()))
            && (this.getDimensionValue() == null ? other.getDimensionValue() == null : this.getDimensionValue().equals(other.getDimensionValue()))
            && (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
            && (this.getAmountYoy() == null ? other.getAmountYoy() == null : this.getAmountYoy().equals(other.getAmountYoy()))
            && (this.getAmountMom() == null ? other.getAmountMom() == null : this.getAmountMom().equals(other.getAmountMom()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getQuantityYoy() == null ? other.getQuantityYoy() == null : this.getQuantityYoy().equals(other.getQuantityYoy()))
            && (this.getQuantityMom() == null ? other.getQuantityMom() == null : this.getQuantityMom().equals(other.getQuantityMom()))
            && (this.getMaxIncrease() == null ? other.getMaxIncrease() == null : this.getMaxIncrease().equals(other.getMaxIncrease()))
            && (this.getMinDecrease() == null ? other.getMinDecrease() == null : this.getMinDecrease().equals(other.getMinDecrease()))
            && (this.getThresholdUpper() == null ? other.getThresholdUpper() == null : this.getThresholdUpper().equals(other.getThresholdUpper()))
            && (this.getThresholdLower() == null ? other.getThresholdLower() == null : this.getThresholdLower().equals(other.getThresholdLower()))
            && (this.getIsAnomaly() == null ? other.getIsAnomaly() == null : this.getIsAnomaly().equals(other.getIsAnomaly()))
            && (this.getCurrencyType() == null ? other.getCurrencyType() == null : this.getCurrencyType().equals(other.getCurrencyType()))
            && (this.getCustomsId() == null ? other.getCustomsId() == null : this.getCustomsId().equals(other.getCustomsId()))
            && (this.getDataSource() == null ? other.getDataSource() == null : this.getDataSource().equals(other.getDataSource()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getMonitorType() == null) ? 0 : getMonitorType().hashCode());
        result = prime * result + ((getMonitorDate() == null) ? 0 : getMonitorDate().hashCode());
        result = prime * result + ((getDimensionValue() == null) ? 0 : getDimensionValue().hashCode());
        result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
        result = prime * result + ((getAmountYoy() == null) ? 0 : getAmountYoy().hashCode());
        result = prime * result + ((getAmountMom() == null) ? 0 : getAmountMom().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getQuantityYoy() == null) ? 0 : getQuantityYoy().hashCode());
        result = prime * result + ((getQuantityMom() == null) ? 0 : getQuantityMom().hashCode());
        result = prime * result + ((getMaxIncrease() == null) ? 0 : getMaxIncrease().hashCode());
        result = prime * result + ((getMinDecrease() == null) ? 0 : getMinDecrease().hashCode());
        result = prime * result + ((getThresholdUpper() == null) ? 0 : getThresholdUpper().hashCode());
        result = prime * result + ((getThresholdLower() == null) ? 0 : getThresholdLower().hashCode());
        result = prime * result + ((getIsAnomaly() == null) ? 0 : getIsAnomaly().hashCode());
        result = prime * result + ((getCurrencyType() == null) ? 0 : getCurrencyType().hashCode());
        result = prime * result + ((getCustomsId() == null) ? 0 : getCustomsId().hashCode());
        result = prime * result + ((getDataSource() == null) ? 0 : getDataSource().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", monitorType=").append(monitorType);
        sb.append(", monitorDate=").append(monitorDate);
        sb.append(", dimensionValue=").append(dimensionValue);
        sb.append(", amount=").append(amount);
        sb.append(", amountYoy=").append(amountYoy);
        sb.append(", amountMom=").append(amountMom);
        sb.append(", quantity=").append(quantity);
        sb.append(", quantityYoy=").append(quantityYoy);
        sb.append(", quantityMom=").append(quantityMom);
        sb.append(", maxIncrease=").append(maxIncrease);
        sb.append(", minDecrease=").append(minDecrease);
        sb.append(", thresholdUpper=").append(thresholdUpper);
        sb.append(", thresholdLower=").append(thresholdLower);
        sb.append(", isAnomaly=").append(isAnomaly);
        sb.append(", currencyType=").append(currencyType);
        sb.append(", customsId=").append(customsId);
        sb.append(", dataSource=").append(dataSource);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}